-
Notifications
You must be signed in to change notification settings - Fork 220
dynamic namespace config #1187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic namespace config #1187
Conversation
@metacosm tomorrow will add tests, but this is the idea, does not look too scary for the moment. |
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/RegisteredController.java
Outdated
Show resolved
Hide resolved
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/RegisteredController.java
Outdated
Show resolved
Hide resolved
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/RegisteredController.java
Outdated
Show resolved
Hide resolved
.../main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManager.java
Outdated
Show resolved
Hide resolved
this.namespaces = namespaces != null ? Set.of(namespaces) : Collections.emptySet(); | ||
return this; | ||
return withNamespaces( | ||
namespaces != null ? Set.of(namespaces) : ResourceConfiguration.DEFAULT_NAMESPACES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This DEFAULT_NAMESPACES
is a little confusing. Should we rename this to WATCH_ALL_NAMESPACES_ON_CLUSTER
or such?
Since it is already defined as:
Set<String> DEFAULT_NAMESPACES = Collections.singleton(Constants.WATCH_ALL_NAMESPACES);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used DEFAULT_NAMESPACES
because I thought it'd be a good idea to decouple the notion of what is used for the default value from the actual value so that it's clear at the usage site that we're using the default value because that's what should be used at that spot instead of an arbitrary value.
I do agree that it's a little confusing but I think it's better to keep this semantics to make it explicit that the default value is used at these spots. This way, the code using the value should also not change if the default value were to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that makes sense, I just I think found some places where it was not used, just the value directly, will rather then create PR for that if I find it again (can't remember where it was)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's possible, unfortunately, ran into a couple of such occurrences myself as well and tried to fix them when I could.
...framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/NamespaceChangeable.java
Show resolved
Hide resolved
I think it's fair to say that target namespaces for change should not contain these placeholders with special meaning just really a list of concrete namespace names. |
...ore/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java
Show resolved
Hide resolved
dd08cc2
to
abc4da2
Compare
...ore/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java
Show resolved
Hide resolved
...work-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceManager.java
Show resolved
Hide resolved
...le-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java
Outdated
Show resolved
Hide resolved
Wonder if we should do something like this with labels, but that is not that straightforward semantically. So would rather create a issue for that to discuss. |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.